# -*- coding: utf-8 -*-
from django.urls import path
from rest_framework import routers
from app.emergency.views.area_plan import AreaPlanViewSet
from app.emergency.views.area_plan_types import AreaPlanTypesViewSet
from app.emergency.views.device_plan import DevicePlanViewSet
from app.emergency.views.material import MaterialViewSet
from app.emergency.views.material_address import MaterialAddressViewSet
from app.emergency.views.plan_inpersion import PlanInpersionViewSet
from app.emergency.views.plan_outpersion import PlanOutpersionViewSet
from app.emergency.views.sample_plan import SamplePlanViewSet

system_url = routers.DefaultRouter()

system_url.register(r'sample_plan', SamplePlanViewSet)
system_url.register(r'material', MaterialViewSet)
system_url.register(r'material_address', MaterialAddressViewSet)
system_url.register(r'area_plan', AreaPlanViewSet)
system_url.register(r'area_plan_types', AreaPlanTypesViewSet)
system_url.register(r'plan_inpersion', PlanInpersionViewSet)
system_url.register(r'plan_outpersion', PlanOutpersionViewSet)
system_url.register(r'device_plan', DevicePlanViewSet)

urlpatterns = [
    path('area_plan/road/<str:pk>/', AreaPlanViewSet.as_view({'get': 'get_plan_by_road'})),
    path('area_plan/struct/<str:pk>/', AreaPlanViewSet.as_view({'get': 'get_plan_by_struct'})),
    path('sample_plan/road/<str:pk>/', SamplePlanViewSet.as_view({'get': 'get_plan_by_road'})),
    path('area_plan_types/condition/', AreaPlanTypesViewSet.as_view({'get': 'get_plan_type_by_condition'})),

]

urlpatterns += system_url.urls
